﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpShare.Storage.FileSystem {
    internal sealed class PathComparer : IEqualityComparer<string> {
        private StringComparer _textComparer = StringComparer.OrdinalIgnoreCase;

        #region IEqualityComparer<string> Members

        public bool Equals(string x, string y) {
            return PathUtils.IsEqual(x, y);
        }

        public int GetHashCode(string obj) {
            return _textComparer.GetHashCode(PathUtils.Canonicalize(obj));
        }

        #endregion
    }
}
